package ycj.learn.spring.listen;

import org.springframework.context.event.ContextClosedEvent;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class Listener {

    @EventListener(ContextRefreshedEvent.class)
    public void listenContextRefreshedEvent(ContextRefreshedEvent event) {
        System.out.println("ContextRefreshedEvent");
    }

    @EventListener(ContextClosedEvent.class)
    public void listenContextClosedEvent(ContextClosedEvent event) {
        System.out.println("ContextClosedEvent");
    }


}
